<template>
  <div class="com-table">
    <el-table class="" :data="data" row-key="id">
      <template slot="empty">
        <div style="height: 300px; padding-top: 50px">
          <span>暂无数据</span>
        </div>
      </template>
      <column-item  v-for="(item,index) in col" :key="index" :col="item" :childrenProp="childrenProp"></column-item>
    </el-table>
  </div>
</template>

<script>
import ColumnItem from '@/components/CommonTable/ColumnItem'

export default {
  name: 'ColumnTable',
  components: {
    ColumnItem
  },
  props: {
    col: {
      type: Array,
      default: () => []
    },
    data: {
      type: Array,
      default: () => []
    },
    childrenProp: {
      type: String,
      default: 'children'
    }
  },
  methods: {
  }
}
</script>

<style lang="scss" scoped>
  .com-table /deep/ .el-table {
    .el-table__expand-icon {
      margin-left: -24px;
    }
  }
</style>
